package com.zw.yzk.kabu.mapper;

import com.zw.yzk.kabu.data.network.entity.CosplayDetailsEntity;
import com.zw.yzk.kabu.model.CosDetailsImageModel;

import java.util.ArrayList;
import java.util.List;

import javax.inject.Inject;

/**
 * Created by zhanwei on 2017/2/25.
 */

public class CosDetailsImageMapper {

    @Inject
    public CosDetailsImageMapper() {

    }

    public CosDetailsImageModel transfer(CosplayDetailsEntity.CosDetails details) {
        CosDetailsImageModel model = new CosDetailsImageModel();
        model.setImageUrl(details.image);
        model.setId(details.imageId);
        model.setMessage(details.content);

        return model;
    }

    public List<CosDetailsImageModel> transfer(List<CosplayDetailsEntity.CosDetails> detailsList) {
        List<CosDetailsImageModel> models = new ArrayList<>();
        for (CosplayDetailsEntity.CosDetails details : detailsList) {
            models.add(transfer(details));
        }

        return models;
    }
}
